import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import "./router/permission.js";
import store from "./store";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import QianKun from "@/qiankun-child";
Vue.use(ElementUI);
Vue.config.productionTip = false;
let instance = null;
function render() {
  instance = new Vue({
    router,
    store,
    render: (h) => h(App),
  }).$mount("#app");
}
if (window.__POWERED_BY_QIANKUN__) {
  /* eslint-disable */
  __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
}
if (!window.__POWERED_BY_QIANKUN__) {
  render();
}
export async function bootstrap(props) {
  // Vue.use(QianKun, { router, store, props });
}
export async function mount(props) {
  Vue.use(QianKun, { router, store, props });
  render(props);
}
export async function unmount() {
  instance.$destroy();
  instance.$el.innerHTML = "";
  instance = null;
}
